package com.example.demo.controller;
import com.example.demo.model.Student;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class HelloController {
    @GetMapping("hello")
    public String hello() {
        return "hello world";
    }

    @GetMapping("stu")
    public Student stu() {
        return new Student("asd","tom");
    }
//    @GetMapping("list")
    public List<Student> list(){
        ArrayList<Student> student=new ArrayList<>();
        student.add(new Student("1","tom"));
        student.add(new Student("2","jerry"));
        return student;
    }
}